#!/usr/bin/env python3
# -*- coding:utf-8 -*-

# ======================================================
# @File:  : pack_installation
# @Author : forward_huan
# @Date   : 2023/11/20 22:32
# @Desc   :
# ======================================================
import os

from PackUtil.version import getVersionConfig
from common.utils.path_utils import getRootPath
from PackUtil.pack.pack_installation import build as build_exe

from image_to_base64.model.image_path import ImagePath


def build():
    root_path = getRootPath()
    py_path = os.path.join(root_path, "startup.py")
    config_path = os.path.join(root_path, "image_to_base64", "res", "config", "version.conf")
    icon_path = ImagePath.IMG_LOGO
    product_name = "图片转base64"
    res_data = [("image_to_base64\\res", "image_to_base64\\res")]
    version_conf = getVersionConfig(
        product_name=product_name, recreate=True, root_path=root_path, config_path=config_path)
    build_exe(
        py_path, product_name, "ImageToBase64", "ForwardHuan", inner_name="client", icon_path=icon_path,
        res_data=res_data, root_path=root_path,
        version_conf=version_conf
    )


if __name__ == '__main__':
    build()
